const storageSetting = JSON.parse(localStorage.getItem("layout-setting") as string) || "";

const useSettingsStore = defineStore("settings", {
	state: () => ({
		title: "",
		metaTitle: "",
		theme: storageSetting.theme || "#6283EF"
	}),
	actions: {
		// 设置主题色
		setTheme(theme: string) {
			this.theme = theme;
		},
		// 设置网页标题
		setTitle(title: any) {
			this.title = title;
		},
		// 设置网页标题
		changeMetaTitle(title: any) {
			this.metaTitle = title;
		}
	}
});

export default useSettingsStore;
